import Vue from 'vue'
import Router from 'vue-router'

import Substation from './views/Substation.vue'
import User from './views/User.vue'
import Log from './views/Log.vue'
import Statistics from './views/Statistics.vue'
import AreaChangeRecord from './views/AreaChangeRecord.vue'
import AreaData from './views/AreaData.vue'
import MachineData from './views/MachineData.vue'
import AddArea from './views/AddArea.vue'
import AreaInfo from './views/AreaInfo.vue'
import EditUser from './views/EditUser.vue'
import MachineList from './views/MachineList.vue'
import EditMachine from './views/EditMachine.vue'
import AreaListOfUser from './views/AreaListOfUser.vue'
import ChangeRecord from './views/ChangeRecord.vue'

Vue.use(Router)


export default new Router({
  routes: [{
      path: '/',
      name: 'login',
      component: () => import('./views/Login.vue'),
    },
    {
      path: '/substation',
      name: 'substation',
      component: () => import('./views/Main.vue'),
      children: [{
        path: '/substation',
        components: {
          main: Substation
        }
      }, {
        path: '/user',
        components: {
          main: User
        }
      }, {
        path: '/log',
        components: {
          main: Log
        }
      }, {
        path: '/statistics',
        components: {
          main: Statistics
        }
      }, {
        path: '/areaChangeRecord',
        components: {
          main: AreaChangeRecord
        }
      }, {
        path: '/areaData',
        components: {
          main: AreaData
        }
      }, {
        path: '/machineData',
        components: {
          main: MachineData
        }
      }, {
        path: '/addArea',
        components: {
          main: AddArea
        }
      }, {
        path: '/areaInfo',
        components: {
          main: AreaInfo
        }
      }, {
        path: '/editUser',
        components: {
          main: EditUser
        }
      }, {
        path: '/machineList',
        components: {
          main: MachineList
        }
      }, {
        path: '/editMachine',
        components: {
          main: EditMachine
        }
      }, {
        path: '/areaListOfUser',
        components: {
          main: AreaListOfUser
        }
      }, {
        path: '/changeRecord',
        components: {
          main: ChangeRecord
        }
      }]
    }
  ]
})